home *** CD-ROM | disk | FTP | other *** search
/ Java Primer Plus / Java Primer Plus (Waite Group Proess)(1996).iso / chapter16 / native.c < prev    next >
C/C++ Source or Header  |  1995-12-31  |  583b  |  24 lines

  1. /* Implementation of Native code */
  2. /* must be compiled by architecture specific C compiler */
  3.  
  4. #include "StubPreamble.h"
  5. #include "java_lang_String.h"
  6. #include "MyNativeClass.h"
  7. #include <stdio.h>
  8.  
  9. void MyNativeClass_setx(struct HMyNativeClass *this, long x)
  10. {
  11.     unhand(this)->x = x; /* dereference the x element of the
  12.                     calling class and assign it the
  13.                     value of x */
  14. }
  15.  
  16.  
  17. void MyNativeClass_sety(struct HMyNativeClass *this, long y)
  18. {
  19.     unhand(this)->y = y; /* dereference the y element of the
  20.                     calling class and assign it the
  21.                     value of y */
  22. }
  23.  
  24.